//
//  HTDriverMainCell.m
//  TruckUser
//
//  Created by Ting Han on 2017/10/31.
//  Copyright © 2017年 Ting Han. All rights reserved.
//

#import "HTDriverMainCell.h"
@interface HTDriverMainCell ()
@property (weak, nonatomic) IBOutlet UILabel *startLabel;
@property (weak, nonatomic) IBOutlet UILabel *endLabel;
@property (weak, nonatomic) IBOutlet UILabel *truckTypeLabel;
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;

@end
@implementation HTDriverMainCell

- (void)setDriverMainCellModel:(HTDriverMainCellModel *)driverMainCellModel{
    _driverMainCellModel = driverMainCellModel;
    self.startLabel.text = driverMainCellModel.from;
    self.endLabel.text = driverMainCellModel.to;
    NSString *length = [HTUtils sortLengthDisplayStringWith:driverMainCellModel.length];
    NSString *type = @"不限车型";
    if (!(driverMainCellModel.cartype == nil ||driverMainCellModel.cartype.length <= 0)) {
        type = driverMainCellModel.cartype;
    }
    NSString *dun = @"";
    if ([driverMainCellModel.unti isEqualToString:@"1"]) {
        dun =[NSString stringWithFormat:@"%@吨",driverMainCellModel.weight];
    }else{
        dun =[NSString stringWithFormat:@"%@方",driverMainCellModel.weight];
    }
    NSString *cartype = @"";
    if (!(driverMainCellModel.goodstype == nil || driverMainCellModel.goodstype.length <= 0)) {
        cartype = driverMainCellModel.goodstype;
    }
    self.truckTypeLabel.text = [NSString stringWithFormat:@"%@ %@ / %@ %@ / 运费%@元",length,cartype,dun,type,driverMainCellModel.picer];
    self.timeLabel.text = [HTUtils timeIntervalExchange:driverMainCellModel.createtime];
}
- (void)awakeFromNib {
    [super awakeFromNib];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
